<%@page import="java.sql.Connection"%>
<%@page import="cn.jhc.dao.NewUserDao"%>
<%@page import="cn.jhc.bean.UserBean"%>
<%@page import="cn.jhc.bean.AllHfmsgBean"%>
<%@page import="java.util.ArrayList"%>
<%@page import="cn.jhc.dao.ConnectionFactory"%>
<%@page import="cn.jhc.dao.ShowmvDAO"%>
<%@page import="cn.jhc.bean.ShowmvBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/flash.css"></link>
<title>每月之星</title>
</head>
<script language="javascript">
	function fsubmit(obj) {
		obj.submit();
	}
	function MM_popupMsg(msg) {
		alert(msg);
	}
</script>
<body>
	<div id="wrapper">
		<jsp:include page="./header.jsp"></jsp:include>
		<div id="address">
			<a>当前位置： 每月之星</a>
		</div>
		<div id="imageTitle">
			<%
				String id = request.getParameter("id");
				int Id = Integer.parseInt(id);
				ShowmvBean s = new ShowmvBean();
				ShowmvDAO dao = new ShowmvDAO();
				dao.setCon(ConnectionFactory.getConnection());
				s = dao.getOneflash(Id);
				request.setAttribute("flash", s);
			%>
			<%
				int AgreedNum;
				dao.setCon(ConnectionFactory.getConnection());
				AgreedNum = dao.getYesNum(Id);
			%>
			<%
				int AgainstNum;
				dao.setCon(ConnectionFactory.getConnection());
				AgainstNum = dao.getNoNum(Id);
			%>
			<%
				String Vote;
				UserBean user = (UserBean) session.getAttribute("user");
				if (null != user) {
					int userid = user.getId();
					NewUserDao dao2 = new NewUserDao();
					dao2.setCon(ConnectionFactory.getConnection());
					Vote = dao2.getVote(userid);
			%>
			<%
				if (Vote.equals("yes")) {
			%>
			<div class="zancheng">
				<a href="showonemv.jsp?id=${requestScope.flash.id}"
					onclick="MM_popupMsg('对不起！您已经投过一票了.')"><img
					src="images/zancheng.jpg"></a>
			</div>
			<div class="zannum">(${requestScope.flash.agreed})</div>
			<div class="fandui">
				<a href="showonemv.jsp?id=${requestScope.flash.id}"
					onclick="MM_popupMsg('对不起！您已经投过一票了.')"><img
					src="images/fandui.jpg"></a>
			</div>
			<div class="fannum">(${requestScope.flash.against})</div>
			<%
				} else {
			%>
			<div class="zancheng">
				<a
					href="yes.do?i=<%=AgreedNum+1%>&id=${requestScope.flash.id}&getb=showonemv.jsp?id=${requestScope.flash.id}"><img
					src="images/zancheng.jpg"></a>
			</div>
			<div class="zannum">(${requestScope.flash.agreed})</div>
			<div class="fandui">
				<a
					href="no.do?i=<%=AgainstNum+1%>&id=${requestScope.flash.id}&getb=showonemv.jsp?id=${requestScope.flash.id}"><img
					src="images/fandui.jpg"></a>
			</div>
			<div class="fannum">(${requestScope.flash.against})</div>
			<%
				}
				} else {
			%>
			<div class="zancheng">
				<a
					href="yes.do?i=<%=AgreedNum+1%>&id=${requestScope.flash.id}&getb=showonemv.jsp?id=${requestScope.flash.id}"><img
					src="images/zancheng.jpg"></a>
			</div>
			<div class="zannum">(${requestScope.flash.agreed})</div>
			<div class="fandui">
				<a
					href="no.do?i=<%=AgainstNum+1%>&id=${requestScope.flash.id}&getb=showonemv.jsp?id=${requestScope.flash.id}"><img
					src="images/fandui.jpg"></a>
			</div>
			<div class="fannum">(${requestScope.flash.against})</div>
			<%
				}
			%>
			<div class="flash">
				<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
					codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
					width="320" height="240" id="FLVPlayer">
					<param name="movie" value="/college/UserFiles/Flash/FLVPlayer_Progressive.swf" />
					<param name="salign" value="lt" />
					<param name="quality" value="high" />
					<param name="scale" value="noscale" />
					<param name="FlashVars" value="&MM_ComponentVersion=1&skinName=/college/UserFiles/Flash/Corona_Skin_3&streamName=/college/UserFiles/Flash/${requestScope.flash.flashname}&autoPlay=false&autoRewind=false" />
					<embed src="/college/UserFiles/Flash/FLVPlayer_Progressive.swf"
						flashvars="&MM_ComponentVersion=1&skinName=/college/UserFiles/Flash/Corona_Skin_3&streamName=/college/UserFiles/Flash/${requestScope.flash.flashname}&autoPlay=false&autoRewind=false"
						quality="high" scale="noscale" width="320" height="240"
						name="FLVPlayer" salign="LT" type="application/x-shockwave-flash"
						pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" />
				</object>
			</div>
			<div class="top">
				<a>${requestScope.flash.title}</a>
			</div>
			<div class="top_line"></div>
			<div class="context">
				<div class="context_title">
					<a> ${requestScope.flash.context}</a>
				</div>
				<div class="context_date">
					<a>发布时间： ${requestScope.flash.date}</a>
				</div>
			</div>
		</div>
		<%
			int CurrentPage = 1;
			dao.setCon(ConnectionFactory.getConnection());
			ArrayList<AllHfmsgBean> h = new ArrayList<AllHfmsgBean>();
			h = dao.getHFMessages(Id, CurrentPage);
			request.setAttribute("liuyan", h);
		%>
		<div id="upload_message">
			<div class="upload_msg">
				<a>留言:</a>
				<div class="under_line"></div>
			</div>
			<c:forEach var="liuyan" items="${requestScope.liuyan}">
				<div class="msg_name" align="left">
					<a>${liuyan.displayname}: ${liuyan.content}</a>
				</div>
				<div class="under_line"></div>
			</c:forEach>
		</div>
		<div id="submit_bg"></div>
		<div id="submit">
			<form name="form" method="post"
				action="./addmvmessage.do?uploadmv_id=${requestScope.flash.id}&getb=/showonemv.jsp&id=${requestScope.flash.id}">
				<p>
					<textarea rows="10" cols="99%" name="content"></textarea>
				</p>
				<input type="hidden" name="getb"
					value="/showonemv.jsp?id=${requestScope.flash.id}">
				<div id="tijiao">
					<a href="javascript:fsubmit(document.form);"><img
						src="images/button.jpg" width="100"></a>
				</div>
			</form>
		</div>
		<div id="line3"></div>
		<div id="copyright">
			<a>&copy;版权所有:蓝调吉他社 </a><a>| </a>
			<div id="admin">
				<a href="houtai_index.jsp">管理员登录</a>
			</div>
		</div>
	</div>
	</div>
</body>
</html>